export const changeTreeNodeKey = ({ commit }, key) => {
  commit('CHANGE_TREE_NODE_KEY', key)
}

export const changeVideoLayoutType = ({ commit }, type) => {
  new Promise(resolve => {
    commit('CHANGE_VIDEO_LAYOUT_TYPE', type)
    resolve(type)
  }).then(type => {
    commit('CAMERA_PAGES_GROUP')
  })
}
export const changeLayoutSelected = ({ commit }, id) => {
  commit('CHANGE_LAYOUT_SELECTED', id)
}
export const changeVideoLayoutList = ({ commit }, list) => {
  commit('CHANGE_VIDEO_LAYOUT_LIST', list)
}
export const removeVideoPlayer = ({ commit }, id) => {
  commit('REMOVE_VIDEO_PLAYER', id)
}
export const addVideoPlayer = ({ commit }, size) => {
  commit('ADD_VIDEO_PLAYER', size)
}
export const cutVideoPlayer = ({ commit }, size) => {
  commit('CUT_VIDEO_PLAYER', size)
}
export const setCameraInfo = ({ commit }, obj) => {
  commit('SET_CAMERA_INFO', obj)
}
export const setReplayInfo = ({ commit }, obj) => {
  commit('SET_REPLAY_INFO', obj)
}
export const changeReplayTime = ({ commit }, time) => {
  commit('CHANGE_REPLAY_TIME', time)
}
export const changeIsManual = ({ commit }, flag) => {
  commit('CHANGE_IS_MANUAL', flag)
}
export const changeReplayPosition = ({ commit }, num) => {
  commit('CHANGE_REPLAY_POSITION', num)
}
export const setReplayItemTime = ({ commit }, obj) => {
  commit('SET_REPLAY_ITEM_TIME', obj)
}
export const changeIsReplace = ({ commit }, flag) => {
  commit('CHANGE_IS_REPLACE', flag)
}
export const changeAuthorizationId = ({ commit }, id) => {
  commit('CHANGE_AUTHORIZATION_ID', id)
}
export const changeLayoutConfig = ({ commit }, obj) => {
  commit('CHANGE_LAYOUT_CONFIG', obj)
}

export const addCameraList = ({ commit }, obj) => {
  commit('ADD_CAMERA_LIST', obj)
}
export const cutCameraList = ({ commit }, obj) => {
  commit('CUT_CAMERA_LIST', obj)
}
export const cameraPagesGroup = ({ commit }) => {
  commit('CAMERA_PAGES_GROUP')
}
export const cameraChangeState = ({ commit }, flag) => {
  commit('CAMERA_CHANGE_STATE', flag)
}
export const cameraCheckedClear = ({ commit }) => {
  commit('CAMERA_CHECKED_CLEAR')
}

export const nextCameraPage = ({ commit }) => {
  commit('NEXT_CAMERA_PAGE')
}

export const prevCameraPage = ({ commit }) => {
  commit('PREV_CAMERA_PAGE')
}

export const stopCarousel = ({ commit }) => {
  commit('STOP_CAROUSEL')
}

export const changeCarouselTime = ({ commit }, time) => {
  commit('CHANGE_CAROUSEL_TIME', time)
}

export const changeCarouselSwitch = ({ commit }, flag) => {
  commit('CHANGE_CAROUSEL_SWITCH', flag)
}

export const changeCarouselTimer = ({ commit }, timer) => {
  commit('CHANGE_CAROUSEL_TIMER', timer)
}

export const changeIsPtzShow = ({ commit }, flag) => {
  commit('CHANGE_IS_PTZ_SHOW', flag)
}